﻿Public Class frmRegistrarNivel
    Private vtn_frmListaTutores As frmListaTutores = New frmListaTutores
    Private res As DialogResult
    Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter

    End Sub

    Private Sub btnbuscarTutor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbuscarTutor.Click
        'Dim vtn_frmListaTutores As frmListaTutores = New frmListaTutores()
        'vtn_frmListaTutores.Show()
        res = vtn_frmListaTutores.ShowDialog()
        If (res = DialogResult.OK) Then
            If vtn_frmListaTutores.dgvTutores.SelectedRows.Count = 1 Then
                'With vtn_frmListaTutores.dgvTutores.SelectedRows.Item(0)
                Me.txtTutor.Text = vtn_frmListaTutores.dgvTutores.SelectedRows.Item(0).Cells(0).Value
                'End With
            End If
        End If
    End Sub

    Private Sub btnBuscarCurso_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBuscarCurso.Click
        Dim vtn_frmBusquedaCursos As frmBusquedaCursos = New frmBusquedaCursos()
        vtn_frmBusquedaCursos.Show()
    End Sub

    Private Sub btnBuscarAlumnos_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBuscarAlumnos.Click
        Dim vtn_frmBúsquedaAlumnos As frmBúsquedaAlumnos = New frmBúsquedaAlumnos()
        vtn_frmBúsquedaAlumnos.Show()
    End Sub

    Private Sub btnEliminarCurso_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEliminarCurso.Click
        For i = 0 To Me.dgvCurso.SelectedRows.Count - 1
            Me.dgvCurso.Rows.RemoveAt(Me.dgvCurso.SelectedRows.Item(0).Index)
        Next i
    End Sub

    Private Sub btnEliminarAlumno_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEliminarAlumno.Click
        For i = 0 To Me.dgvAlumno.SelectedRows.Count - 1
            Me.dgvAlumno.Rows.RemoveAt(Me.dgvAlumno.SelectedRows.Item(0).Index)
        Next i
    End Sub
    Private Sub btnGuardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGuardar.Click

    End Sub
#Region "VALIDACIONES"
    'Valida que se desee realmente cancelar la transaccion
    Private Sub btnCancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancelar.Click
        If MessageBox.Show("¿Desea cancelar la transacción?", "Aviso", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = Windows.Forms.DialogResult.Yes Then
            'Button 1 es el Si, Button 2 es el No, Button 3 es el Cancel
            Me.Close()
            Me.Dispose()

        End If
    End Sub
#End Region

    
End Class